package cn.com.oceansoft.application.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/**
 * Created by zhangxh on 2016/9/19.
 */
@Configuration
@EnableWebMvc
@EnableSwagger2
@ComponentScan("cn.com.oceansoft.modules.demo")
public class SwaggerConfig {
    @Bean
    public Docket customDocket(){
//        return new Docket(DocumentationType.SWAGGER_2);
////        添加api文档信息
        Docket docket=new Docket(DocumentationType.SWAGGER_2);
        ApiInfo apiInfo = new ApiInfoBuilder().title("演示文档")
                .description("演示API接口文档")
                .termsOfServiceUrl("http://blog.didispace.com/")
                .license("欧索软件")
                .licenseUrl("http://www.oceansoft.com.cn/")
                .contact("产品部")
                .version("1.0")
                .build();
        docket.apiInfo(apiInfo);
        return docket;

    }
}
